package com.guyu.plugin.mybatis.helper;

import com.guyu.common.web.util.GuyuSpringUtils;
import com.guyu.plugin.mybatis.listener.FlexExtListener;
import com.guyu.plugin.mybatis.listener.FlexUserListener;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class MybatisFlexHelper {

    public static FlexUserListener getUserListener() {
        FlexUserListener listener = null;
        try {
            listener = GuyuSpringUtils.getBean(FlexUserListener.class);
        } catch (Exception e) {
            log.warn(">>>>>> Spring 未加载 FlexUserListener");
        }
        return listener;
    }

    public static FlexExtListener getExtListener() {
        FlexExtListener listener = null;
        try {
            listener = GuyuSpringUtils.getBean(FlexExtListener.class);
        } catch (Exception e) {
            log.warn(">>>>>> Spring 未加载 FlexExtListener");
        }
        return listener;
    }
}
